#include <iostream>
#include <string>
using namespace std;
int main() {
  // 1. 相同的内容分组
  // 2. to_string()
  string str, res;
  cin >> str;
  char lastChar = str[0];
  int length = 1;
  for (int i = 1; i <= str.length(); i ++) {
    if (str[i] == lastChar) {
      length ++;
    } else {
      res += to_string(length) + lastChar;
      lastChar = str[i];
      length = 1;
    }
  }
  cout << res << endl;
}